//
//  SEGSignADCell.m
//  SEGUhomeSommunitySocial
//
//  Created by 乔杨 on 2019/4/12.
//  Copyright © 2019 刘山. All rights reserved.
//

#import "SEGSignADCell.h"
@interface SEGSignADCell ()

/** 图片 */
@property (nonatomic, strong) UIImageView *adImgView;

@end

@implementation SEGSignADCell

- (instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier {
    self = [super initWithStyle:style reuseIdentifier:reuseIdentifier];
    if (self) {
        self.backgroundColor = kColor_W;
        self.selectionStyle = UITableViewCellSelectionStyleNone;
        [self createUI];
    }
    return self;
}

- (void)createUI {
    self.adImgView = [[UIImageView alloc] initWithFrame:CGRectMake(15, 15, kScreenWidth-30, 115)];
    self.adImgView.layer.cornerRadius = 8.f;
    self.adImgView.layer.masksToBounds = YES;
    self.adImgView.userInteractionEnabled = YES;
    self.adImgView.contentMode = UIViewContentModeScaleAspectFill;
    [self.contentView addSubview:self.adImgView];
}

// 刷新
- (void)signADCell_refreshWithPicURL:(NSString *)picURL {
    NSURL *imgUrl = [NSURL URLWithString:[NSString stringWithFormat:@"%@%@",kClientImageRootURL,picURL]];
    [self.adImgView setImageWithURL:imgUrl
                   placeholderImage:[UIImage imageWithContentsOfFile:SEGPicName(@"pic_default_72_72")]];
    self.adImgView.contentMode = UIViewContentModeScaleAspectFill;
}

@end
